package com.y2.authprj;

import java.net.InetAddress;
import java.net.UnknownHostException;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;


public class WebUtils {

	  //本机的IP地址
	  public String getIpAddress() throws UnknownHostException {   
	        InetAddress address = InetAddress.getLocalHost();   
	        return address.getHostAddress();   
	    }  
	  public static void main(String[] args) {
		
		  WebUtils utils=new WebUtils();
		  try {
			System.out.println(utils.getIpAddress());
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		  
		 
	}
}
